<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>学生登陆</title>

    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        body{
            font-family: "微软雅黑";
            font-size: 14px;
            background: url(<%=request.getContextPath()%>/static/login/stlg_bg.jpg) fixed center center;
        }
        .logo_box{
            width: 280px;
            height: 490px;
            padding: 35px;
            color: #EEE;
            position: absolute;
            left: 50%;
            top:100px;
            margin-left: -175px;
        }
        .logo_box h3{
            text-align: center;
            height: 20px;
            font: 20px "microsoft yahei",Helvetica,Tahoma,Arial,"Microsoft jhengHei",sans-serif;
            color: #FFFFFF;
            height: 20px;
            line-height: 20px;
            padding:0 0 35px 0;
        }
        .input_outer{
            height: 46px;
            padding: 0 5px;
            margin-bottom: 20px;
            border-radius: 50px;
            position: relative;
            border: rgba(255,255,255,0.2) 2px solid !important;
        }
        .u_user{
            width: 25px;
            height: 25px;
            background: url(<%=request.getContextPath()%>/static/login/login_ico.png);
            background-position:  -125px 0;
            position: absolute;
            margin: 12px 13px;
        }
        label{
            color: rgb(255, 255, 255);
            display: block;
        }
        .text{
            width: 220px;
            height: 46px;
            outline: none;
            display: inline-block;
            font: 14px "microsoft yahei",Helvetica,Tahoma,Arial,"Microsoft jhengHei";
            margin-left: 50px;
            border: none;
            background: none;
            line-height: 46px;
        }
        /*///*/
        .mb2{
            margin-bottom: 20px
        }
        .mb2 a{
            text-decoration: none;
            outline: none;
        }
        .submit {
            padding: 15px;
            margin-top: 20px;
            display: block;
        }
        .act-but{
            height: 20px;
            line-height: 20px;
            text-align: center;
            font-size: 20px;
            border-radius: 50px;
            background: #0096e6;
        }

        .wx img{
            width: 16px;
            height: 16px;
            float: left;
            line-height: 27px;
            text-align: center;
        }
        .sas a{
            width: 280px;
            height: 18px;
            color: #FFFFFF;
            text-align: center;
            line-height: 18px;
            text-decoration: none;
        }
         .u-errormessage{
             color: red;
         }
    </style>
</head>
<body>

<script src="<%=request.getContextPath()%>/static/login/js/jquery-2.1.1.min.js" type="text/javascript"></script>

<div class="logo_box">
    <h3>作业系统欢迎你</h3>
    <form action="#" name="f" method="post">
        <div class="input_outer">
            <span class="u_user"></span>
            <input id="username" class="text" autocomplete="off" onFocus=" if(this.value=='输入学生编号') this.value=''" onBlur="if(this.value=='') this.value='输入学生编号'" value="输入学生编号" style="color: #FFFFFF !important" type="text">
        </div>
        <div class="">
            <span class="help-block u-errormessage" id="msg">&nbsp;</span>
        </div>
        <div class="mb2"><a class="act-but submit" onclick="login()" style="color: #FFFFFF">登录</a></div>
    </form>
</div>
</body>
<script>
    function login() {
        var username = $("#username").val();
        if($.trim(username)==""){
            $("#msg").html("请输入学号！");
            return;
        }
        $.ajax({
            url:"<%=request.getContextPath()%>/stu/dologin",
            type:"post",
            data:{username:username},
            dataType:"json",
            success:function (res) {
                if(res.code==0){
                    location.href="<%=request.getContextPath()%>/stu/index";
                }else{
                    $("#msg").html(res.msg);
                }
            }
        });
    }

</script>
</html>
